<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>23布局技巧2</title>

    <style>
      .parent {
        width: 300px;
        height: 300px;
        background-color: rosybrown;
        overflow: hidden;
        text-align: center;
        line-height: 300px;
      }

      .child {
        background-color: orange;
        font-size: 20px;
      }
    </style>
  </head>
  <body>
    <!-- 行内元素，或者是行内块元素，可以用textalign或者是line-height要记住 -->
    <div class="parent">
      <span class="child">nodejs</span>
    </div>
  </body>
</html>
